// @(#)dispatch.hh
// Time-stamp: <2008-11-21 11:27:03 root>
// Copyright 2008 Julian Qian
// Author: root@localhost.localdomain
// Version: $Id: dispatch.hh,v 0.0 2008/11/17 17:14:15 root Exp $
// Keywords: 
//

#ifndef _DISPATCH_H
#define _DISPATCH_H 1


typedef	void (*Sigfunc)(int);	// For Signal handlers

class Dispatch {
public:
#define CAST_(t) static_cast<Sigfunc>(t)
    
    static Dispatch* theDispatch();
    void engine(Sigfunc func, int delay);
protected:
    Dispatch();
    virtual ~Dispatch();
    
    Sigfunc signal(int signo, Sigfunc func);
    Sigfunc Signal(int signo, Sigfunc func);

    static Dispatch* _theDispatch;
};

#endif /* _DISPATCH_H */

